<template>
  <div class="goods-list1">
    <div class="goods" v-for="(item,index) in productList" :key="index">
      <router-link :to="{name:'details',params:{id:item.content}}">
        <img :src="item.background_image" alt="">
        <h2>{{ item.title }}</h2>
        <p>售价 {{ item.product.current_price }}</p>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: "GoodsList1",
  props: {
    productList: Array
  },
  data() {
    return {}
  },
// 侦听器
  watch: {},
// 计算属性
  computed: {},
// 事件
  methods: {},
// 生命周期
  created() {
  },
  mounted() {
  }
}
</script>

<style lang="scss" scoped>
.goods-list1 {
  padding: 50px 0;
  box-sizing: border-box;
  width: 100%;

  .goods {
    width: 100%;
    margin-bottom: 70px;

    a {
      img {
        width: 100%;
        height: 100%;
      }

      h2 {
        color: #4a4a4a;
        font-size: 20px;
        margin-top: 15px;
        width: 100%;
        padding: 0 50px;
        text-align: center;
        box-sizing: border-box;
      }

      p {
        text-align: center;
        margin-top: 10px;
        color: #007aff;
        font-size: 14px;
      }
    }
  }

  .goods:last-child {
    margin: 0;
  }
}
</style>